import fs from 'fs-extra';
import { defineConfig } from 'tsup';

export default defineConfig({
  entryPoints: [
    'src/index.ts',
    'src/create.ts',
    'src/init-tpl/index.ts',
    'src/utils/download-git-project.ts',
    'src/init-tpl/initHusky.ts',
  ],
  sourcemap: true,
  clean: true,
  bundle: true,
  splitting: true,
  shims: true,
  plugins: [
    {
      name: 'copy-config-plugin',
      buildStart() {
        fs.copySync('./src/config', 'dist/config');
      },
    },
  ],
});
